home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FishMarket 1.0
/
FishMarket v1.0.iso
/
fishies
/
201-225
/
disk_222
/
plplot
/
src
/
source.zoo
/
round.c
< prev
next >
Wrap
C/C++ Source or Header
|
1989-05-15
|
333b
|
19 lines
/* round rounds a floating point value to an integer value. */
#include "plplot.h"
#include <math.h>
int round(flt)
float flt;
{
double mant, frac;
frac = modf(flt,&mant);
if( fabs(frac) < .5 )
return((int)mant);
else if (frac > 0)
return((int)(++mant));
else
return((int)(--mant));
}